<template>
	<view class="wrap savepadding">
		<u-tabbar activeColor="#12B9A3" inactiveColor="#B6B6B6" :value="tab" :fixed="true" :placeholder="true" :safeAreaInsetBottom="true">
			<u-tabbar-item text="学习专栏" @click="onClick('../../pagesA/course/course')">
				<image style="width:39upx;height:40upx" slot="active-icon" src="@/pagesA/static/tabbar/class_selected.png"></image>
				<image style="width:39upx;height:40upx" slot="inactive-icon" src="@/pagesA/static/tabbar/class_default.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="自我检测" @click="onClick('../../pagesA/practice/practice')">
				<image style="width:39upx;height:37upx" slot="active-icon" src="@/pagesA/static/tabbar/practice_selected.png"></image>
				<image style="width:39upx;height:37upx" slot="inactive-icon" src="@/pagesA/static/tabbar/practice_default.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="学习测验" @click="onClick('../../pagesA/test/test')">
				<image style="width:39upx;height:37upx" slot="active-icon" src="@/pagesA/static/tabbar/test_selected.png"></image>
				<image style="width:39upx;height:37upx" slot="inactive-icon" src="@/pagesA/static/tabbar/test_default.png"></image>
			</u-tabbar-item>
			<u-tabbar-item text="我的" @click="onClick('../../pagesA/mine/mine')">
				<image style="width:37upx;height:39upx" slot="active-icon" src="@/pagesA/static/tabbar/mine_selected.png"></image>
				<image style="width:37upx;height:39upx" slot="inactive-icon" src="@/pagesA/static/tabbar/mine_default.png"></image>
			</u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
export default {
	props: {
		tab: {
			type: Number,
			default: 0
		}
	},
	data() {
		return {};
	},
	methods: {
		onClick(path) {
			console.log(path);
			
			uni.redirectTo({
				url:path,
			})
			
			// uni.switchTab({
			// 	url: path
			// });
		}
	}
};
</script>

<style lang="scss" scoped>
.wrap {
	position: relative;
	z-index: 100;
}
</style>
